package com.xx.controller;

import com.xx.domain.User;
import com.xx.service.ShowUserService;
import com.xx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author : 徐闯 ssm_admin
 * @Date : 2021-05-16 19:05:57
 * @Description : 展示用户信息的控制器
 **/
@Controller
public class ShowUserController {
    @Autowired
    private ShowUserService showUserService;
    @Autowired
    private UserService userService;
    @RequestMapping("/showAllUser")
    @ResponseBody
    //初始化所有用户信息
    public List<User> showAllUser(){
        return showUserService.showAllUser();
    }
    //单个用户详情
    @ResponseBody
    @RequestMapping("/showUserDetails")
    public User showUserDetails(int uId){
        return userService.userDetails(uId);
    }
}
